use diesel::prelude::*;
use salvo::oapi::ToSchema;
use serde::{Deserialize, Serialize};

#[derive(Queryable, Selectable, Serialize, ToSchema)]
#[diesel(table_name = crate::schema::lessons)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Lesson {
    pub id: i64,
    pub name: String,
}

#[derive(Queryable, Selectable, Serialize, ToSchema)]
#[diesel(table_name = crate::schema::sentences)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Sentence {
    pub id: i64,
    pub lesson_id: i64,
    pub origin: String,
    pub target: String,
}